#ifndef _OS_H_
#define _OS_H_

#define list_init(head) \
 do { \
  (head)->next = head; \
  (head)->prev = head; \
 } while (0)

#define list_append(head, node) \
 do { \
  (node)->prev = (head)->prev; \
  (node)->next = (head); \
  (node)->prev->next = (node); \
  (node)->next->prev = (node); \
 } while (0);

#define list_remove(node) \
 do { \
  (node)->prev->next = (node)->next; \
  (node)->next->prev = (node)->prev; \
 } while (0);

#define list_empty(head) ((head)->next == (head))

int server(char *addr, int port);
int client(char *addr, int port);

#endif  // !_OS_H_
